/**
 * Created with PyCharm.
 * User: jay.han
 */
function PlatformCtrl($scope, Util, Platform){
    Util.bind_tab($scope);

    $scope.add_bookmark = function(){
        Util.bookmark($scope, '平台信息', "平台信息快捷方式");
    };

    Platform.info({},function(data){
        $scope.name = data.name;
        $scope.validity = data.validity;
        $scope.total = data.total;
        $scope.available = data.available;
        $scope.version = data.version;
        $scope.hardwareid = data.hardwareid;
        $scope.build = data.build;
    });

    $scope.licenseInfo = ""
    $scope.update_license = function(){
        Util.dialog('/static/partials/platform/license.html', 'PlatformDialogCtrl', $scope);
    }

    $scope.register_license = function(){
        Platform.register_license({"licenseInfo":$scope.licenseInfo},function(data){
            if(data.status==200){
                Util.alert("认证更新成功");
                window.location.href="/web/index.html"
            }else{
                Util.alert(data.msg);
                dialog.close()
            }
        });
    }
}